# This makefile should build using mingw under Windows.
# You might need to adjust the JDKINCLUDES directory.
# BP 080409

RTAUDIO = rtaudio-4.0.5
OBJECTS	=	RtAudio.o

CC       = g++
JJ       = javac
RM       = del
SRC      = src
DEFS     = -DHAVE_GETTIMEOFDAY -D__WINDOWS_DS__ -D_JNI_IMPLEMENTATION_
CFLAGS   = -O2 -Wall -Wl,--kill-at
CFLAGS  += -I$(RTAUDIO) -I$(INCLUDE)/include -I$(SRC)
LIBRARY  = -lole32 -ldsound -lwinmm 
JDKINCLUDES = -I"C:\Program Files\Java\jdk1.6.0_10\include" -I"C:\Program Files\Java\jdk1.6.0_10\include\win32"
JRTSRC = org_jrtaudio_JRtAudio.cpp

all: JRtAudio
JRtAudio : $(SRC)/$(JRTSRC) $(RTAUDIO)/$(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o JRtAudio.dll -shared $(SRC)/$(JRTSRC) $(RTAUDIO)/$(OBJECTS) $(LIBRARY) $(JDKINCLUDES)
	$(JJ) -target 1.5 -d . $(SRC)/*.java
	jar cf JRtAudio.jar org/jrtaudio/*.class
	
